<?php
namespace App\Http\Middleware;

use Closure;
use App\Traits\Weixin;
use App\Traits\BaseFun;

class WeixinLogin
{
     /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request,Closure $next)
    {
                                                                                                                                                

        if(Weixin::isLogin($request)){
            // var_dump(Weixin::isLogin($request));die();
              return $next($request);
           
        }else{
            return response()->json(['state'=>2,'data'=>0,'msg'=>'没有登录']);
        }

    }
}
